package net.openvision.music.composition.rules;

import java.util.Collection;

import net.openvision.music.composition.Element;
import net.openvision.music.composition.ElementValue;
import net.openvision.util.Constraint;

public class ElementClassConstructionRule implements ConstructionRule {

	private ElementSet elementSet;
	private Constraint<ElementValue> constraint;
	
	public ElementClassConstructionRule(ElementSet elementSet, Constraint<ElementValue> constraint) {
		this.elementSet = elementSet;
		this.constraint = constraint;
	}
	
	@Override
	public Collection<Element> complete(Element e) {
		return elementSet.match(e, constraint);
	}

	public void setElementSet(ElementSet elementSet) {
		this.elementSet = elementSet;
	}
}
